//
//  AssetsList.h
//  OntheRoadV4
//
//  Created by ZhangYanhua on 15/1/15.
//  Copyright (c) 2015年 EricHuang. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <AssetsLibrary/AssetsLibrary.h>
#import <Photos/Photos.h>
#import "ImageAsset.h"

typedef enum EnumStatus {
    ASSETS_ENUM_PENDING,
    ASSETS_ENUM_IN_PROGRESS,
    ASSETS_ENUM_ABORT,
    ASSETS_ENUM_FINISHED,
}AssetsEnumStatus;

@class MyAssetsGroup;

@class AssetsList;
@protocol AssetsListProtocol <NSObject>

- (void)asstesListenumFinished:(AssetsList *)list;

@end

@interface AssetsList : NSObject

@property (nonatomic, weak) id<AssetsListProtocol> delegate;
@property (nonatomic, strong) NSString *title;
@property (nonatomic, strong) MyAssetsGroup *myGroup;
@property (nonatomic, assign) BOOL stopQuery;
@property (nonatomic, assign) AssetsEnumStatus enumStatus;
@property (nonatomic, strong) NSMutableArray *videos;
@property (nonatomic, strong) NSMutableArray *photos;
@property (nonatomic, strong) PHFetchResult *photosFetchResult;
@property (nonatomic, strong) PHFetchResult *videosFetchResult;

- (id)initWithAssetsGroup:(MyAssetsGroup *)assetsGroup delegate:(id)delegate;

- (id)initWithAssetsGroup:(MyAssetsGroup *)assetsGroup
        photosFetchResult:(PHFetchResult *)photosFetchResult
        videosFetchResult:(PHFetchResult *)videosFetchResult;

- (void)loadAssetsWithEnumerationBlock:(ALAssetsGroupEnumerationResultsBlock)enumerationBlock;

- (void)loadAssetsForPHAssetsCollection;
@end